use "$data/demog_meta.dta", clear

forvalues i=2010(1)2013{
twoway conn b_`i'_high x_`i'_high if x_`i'_high>=5.5&x_`i'_high<10&as_of==`i',/*
*/ ytitle(No. of Mortgages) graphregion(color(white)) bgcolor(white) xlabel(5.5(1)10) xtitle(Rate Spread) ylabel(0 (1000) 6000) xline(6.5)
graph export "$figures/freq_high_`i'_paper.eps", as(eps) preview(on) replace
}



forvalues i=2014(1)2017{
twoway conn b_`i'_high x_`i'_high if x_`i'_high>=5.5&x_`i'_high<10&as_of==`i',/*
*/ xline(6.5) ytitle(No. of Mortgages) graphregion(color(white)) bgcolor(white) xlabel(5.5(1)10) xtitle(Rate Spread) ylabel(0 (1000) 6000)
graph export "$figures/freq_high_`i'_paper.eps", as(eps) preview(on) replace
}


forvalues i=2010(1)2013{
twoway conn b_`i'_low x_`i'_low if x_`i'_low>=7.5&x_`i'_low<12&as_of==`i',/*
*/ ytitle(No. of Mortgages) graphregion(color(white)) bgcolor(white) xlabel(7.5(1)12) xtitle(Rate Spread) ylabel(0 (1000) 4000) xline(8.5)
graph export "$figures/freq_low_`i'_paper.eps", as(eps) preview(on) replace
}



forvalues i=2014(1)2017{
twoway conn b_`i'_low x_`i'_low if x_`i'_low>=7.5&x_`i'_low<12&as_of==`i',/*
*/ xline(8.5) ytitle(No. of Mortgages) graphregion(color(white)) bgcolor(white) xlabel(7.5(1)12) xtitle(Rate Spread)  ylabel(0 (1000) 4000)
graph export "$figures/freq_low_`i'_paper.eps", as(eps) preview(on) replace
}



